<{include file="top.html"}>
<link rel="stylesheet" type="text/css" href="<{$preStaticUrl}>Wap/css/editors.css"/>
</head>
<body>
<div class="xy-panel">
    <div class="xy-panel-content" style="bottom:0; padding:1rem 0; background:#FFF;">
        <div class="xy-row vDirectionRow">
            <h3 class="RecordTopic"><{$time|date_format:"%m月%d日"}>数据统计</h3>
            <div class="EnteringBox EnteringBox-1">
                <dl>微信总好友数：</dl>
                <form>
                    <input class="EnteringText" type="number" id="friendNum" value="<{$data.friendNum}>" required/>
                </form>
            </div>
            <div class="EnteringBox EnteringBox-2">
                <dl>今日新增好友数：</dl>
                <form>
                    <input class="EnteringText" type="number" id="newFriendNum" value="<{$data.newFriendNum}>" required/>
                </form>
            </div>
            <div class="EnteringBox EnteringBox-3">
                <dl>微信群好友数：</dl>
                <form>
                    <input class="EnteringText" type="number" id="groupFriendNum" value="<{$data.groupFriend}>" required/>
                </form>
            </div>
            <div class="ui-button ui-button-2">
                <a href="javascript:void(0);" onclick="goSave()">保 存</a>
            </div>
        </div>
    </div>
</div>
</body>
</html>
<script>
    function goSave(){
        var friendNum = $("#friendNum").val();
        var newFriendNum = $("#newFriendNum").val();
        var groupFriendNum = $("#groupFriendNum").val();
        if(!friendNum){
            layer.msg("请输入微信总好友数");
            return false;
        } else if(!newFriendNum){
            layer.msg("请输入今日新增好友数");
            return false;
        } else if(!groupFriendNum){
            layer.msg("请输入微信群好友数");
            return false;
        }
        var param = {friendNum:friendNum,newFriendNum:newFriendNum,groupFriendNum:groupFriendNum};
        $.getJSON("<{U('Editor/saveWriteData')}>",param,function(data){
            if(data.status>0){
                layer.msg(data.msg);
            } else{
                layer.msg("录入成功");
                window.location.href = "<{U('Editor/saveSuccess')}>";
            }
        });
    }
</script>